package com.huel.liweijian.Service.Operations;

import com.huel.liweijian.Service.CalculatorService;

/**
 * @author Liweijian.
 * @date 2024/9/4 10:39
 */
public class ModuloOperation implements CalculatorService {
    @Override
    public double calculate(double a, Double b) {
        // 检查除数是否为零
        if (b == null) {
            throw new ArithmeticException("除数不能为零");
        }
        return a % b;
    }
}
